package com.rljk.common.consts;

import com.rljk.common.result.CodeMsg;

/**
 * Author:   YASUO
 * Date:     2018/6/27 13:45
 * Description: redis的key设置常量
 */
public class RedisConst {

    private String key;
    private int expire;



    private RedisConst( ) {
    }

    private RedisConst(String key, int expire) {
        this.key = key;
        this.expire = expire;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public int getExpire() {
        return expire;
    }

    public void setExpire(int expire) {
        this.expire = expire;
    }

    public RedisConst fillArgs(Object... args) {
        int expire = this.expire;
        String message = String.format(this.key, args);
        return new RedisConst(key, expire);
    }

    @Override
    public String toString() {
        return "RedisConst{" +
                "key='" + key + '\'' +
                ", expire=" + expire +
                '}';
    }
}
